﻿//2.	各检验单位的检验结论统计
var xData_104_ = function() {
    var data = ["安徽省特检院","淮南市特检中心","芜湖市特检中心","滁州市特检中心","宣城市特检中心","铜陵市特检中心","阜阳市特检中心","安庆市特检中心","马鞍山市特检中心","淮北市特检中心","蚌埠市特检中心","黄山市特检中心","六安市特检中心","池州市特检中心","宿州市特检中心","安徽省特检院巢湖分院","安徽省特检院亳州检测部"];
    return data;
}();
var legendData_104 = ["1 级","2 级","3 级","4 级","合格","监督运行","其他","允许使用",]
//1级
var _data_104_1 =[0, 0, 90, 671, 0, 0, 0, 1307, 1328, 0, 0, 458, 0, 0, 0, 0, 174]
//2级
var _data_104_2 = [2665, 3785, 2335, 1800, 923, 427, 938, 571, 1636, 753, 1538, 1447, 0, 320, 0, 808, 271]
var  _data_104_3 =[2577, 0, 1, 638, 725, 2, 1, 1, 0, 1, 2, 692, 1, 413, 578, 710, 651]
var  _data_104_4 =[0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 42, 0, 0, 0, 0, 0, 0]
var  _data_104_5 =   [46069, 6691, 5969, 2580, 6248, 5806, 1815, 3537, 3123, 5279, 4235, 4206, 4540, 2494, 2458, 2822, 846]
var  _data_104_6 =  [0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 186, 0, 332, 0, 0]
var  _data_104_7 =   [6188, 3180, 4644, 8781, 5586, 3961, 6700, 4793, 2192, 1409, 1951, 1083, 1482, 3537, 990, 944, 926]
var  _data_104_8 =  [1189, 219, 0, 0, 347, 443, 576, 0, 1407, 878, 0, 0, 263, 354, 934, 45, 0]
option104 = {
    // backgroundColor: "#344b58",
    "title": {
        "text": "",
        "subtext": '',
        x: "4%",

        textStyle: {
            color: '#fff',
            fontSize: '22'
        },
        subtextStyle: {
            color: '#90979c',
            fontSize: '16',

        },
    },
    toolbox: {
        show:true,
        feature: {
            magicType: {
                type: ['line', 'bar', 'stack', 'tiled']
            },
            dataView:{
                show:true,
            },
            restore: {//配置项还原。
                show: true
            },
            saveAsImage: {//保存为图片。
                show: true
            }
        },


    },
    "tooltip": {
        "trigger": "axis",
        "axisPointer": {
            "type": "shadow",
            textStyle: {
                color: "#fff"
            },
        },
    formatter: function(params) {
        // console.log(params)
        var indexX =0;
        for(var x=0;x<xData_104_.length;x++){
            if(params[0].name === xData_104_[x]){
                indexX = x;
                break;
            }
        }
        // console.log(indexX)
        var sum = _data_104_1[indexX] + _data_104_2[indexX] + _data_104_3[indexX] + _data_104_4[indexX] + _data_104_5[indexX]+ _data_104_6[indexX] + _data_104_7[indexX] + _data_104_8[indexX]

        var displayString = '检验单位：' + params[0].name
        for(var m =0;m<params.length;m++){
            var itemString = '<br/>'+ params[m].marker + params[m].seriesName +':数量：' + params[m].data+ '，' + '占比：' + (params[m].data / sum * 100).toFixed(2) + '%，总数:'+sum;
            displayString = displayString + itemString
        }
        return displayString
    }
    },
    "grid": {
        "borderWidth": 0,
        "top": 104,
        "bottom": 95,
        textStyle: {
            color: "#fff"
        }
    },
    "legend": {
        x: '4%',
        top: '5%',
        textStyle: {
            color: '#fff',
            fontSize:16,
        },
        "data": legendData_104
    },


    "calculable": true,
    "xAxis": [{
        "type": "category",
        "position": {
            "bottom": 200,
        },
        "axisLine": {
            lineStyle: {
                color: '#90979c'
            }
        },
        "nameRotate": 90,
        "splitLine": {
            "show": false
        },
        "axisTick": {
            "show": false
        },
        "splitArea": {
            "show": false
        },
        "axisLabel": {
            // "interval": 0,
            textStyle: {
                color: '#fff',
                fontSize: '16'
            },
        },
        "data": xData_104_,
        "offset": 0,
    }],
    "yAxis": [{
        "type": "value",
        "splitLine": {
            "show": false
        },
        "axisLine": {
            lineStyle: {
                color: '#90979c'
            }
        },
        "axisTick": {
            "show": false
        },
        "axisLabel": {
            // "interval": 0,
            textStyle: {
                color: '#fff',
                fontSize: '16'
            },
        },
        "splitArea": {
            "show": false
        },

    }],
    "dataZoom": [{
        "show": true,
        "height": 30,
        "xAxisIndex": [
            0
        ],
        bottom: 30,
        "start": 0,
        "end": 20,
        handleIcon: 'path://M306.1,413c0,2.2-1.8,4-4,4h-59.8c-2.2,0-4-1.8-4-4V200.8c0-2.2,1.8-4,4-4h59.8c2.2,0,4,1.8,4,4V413z',
        handleSize: '104%',
        handleStyle: {
            color: "#d3dee5",

        },
        textStyle: {
            color: "#fff"
        },
        borderColor: "#90979c"


    }, {
        "type": "inside",
        "show": true,
        "height": 15,
        "start": 1,
        "end": 35
    }],
    "series": [
        {
            "name": "1 级",
            "type": "bar",
            //"stack": "总量",
            "itemStyle": {
                "normal": {
                    "color": "rgba(58,95,205,1)",
                    "label": {
                        "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data": _data_104_1
        },
        {
            "name": "2 级",
            "type": "bar",
            //"stack": "总量",
            "barMaxWidth": 35,
            "barGap": "10%",
            "itemStyle": {
                "normal": {
                    "color": "rgba(0,191,183,1)",
                    "label": {
                         "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data":_data_104_2
        },
        {
            "name": "3 级",
            "type": "bar",
            //"stack": "总量",
            "itemStyle": {
                "normal": {
                    "color": "rgba(255,193,193,1)",
                    "label": {
                         "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data": _data_104_3
        },
        {
            "name": "4 级",
            "type": "bar",
            //"stack": "总量",
            "itemStyle": {
                "normal": {
                    "color": "rgba(186,85,211,1)",
                    "label": {
                         "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data": _data_104_4
        },
        {
            "name": "合格",
            "type": "bar",
            //"stack": "总量",
            "barMaxWidth": 35,
            "barGap": "10%",
            "itemStyle": {
                "normal": {
                    "color": "rgba(255,185,15,1)",
                    "label": {
                         "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data":_data_104_5
        },
        {
            "name": "监督运行",
            "type": "bar",
            //"stack": "总量",
            // symbolSize: 10,
            // symbol: 'circle',
            "itemStyle": {
                "normal": {
                    "color": "rgba(252,230,48,1)",
                    "barBorderRadius": 0,
                    "label": {
                         "show": true,
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data": _data_104_6
        },
        {
            "name": "其他",
            "type": "bar",
            //"stack": "总量",
            "barMaxWidth": 35,
            "barGap": "10%",
            "itemStyle": {
                "normal": {
                    "color": "rgba(255,144,128,1)",
                    "label": {
                         "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data":_data_104_7
        },

        {
            "name": "允许使用",
            "type": "bar",
            //"stack": "总量",
            "itemStyle": {
                "normal": {
                    "color": "rgba(255,106,106,1)",
                    "label": {
                         "show": true,
                        "textStyle": {
                            "color": "#fff"
                        },
                        "position": "top",
                        formatter: function(p) {
                            return p.value > 0 ? (p.value) : '';
                        }
                    }
                }
            },
            "data":_data_104_8
        },
    ]
}
